Rebuild Taskyou Pilot on SvelteKit + Cloudflare#453
Closed
Conversation
Port the original React+Go pilot web app to a modern SvelteKit application deployed on Cloudflare Workers, replacing Fly Sprites with Cloudflare Sandbox SDK for per-user isolated execution environments. Stack: - SvelteKit 5 with Svelte 5 runes ($state, $derived, $props) - Cloudflare Workers with adapter-cloudflare - Cloudflare D1 for database, KV for sessions - Cloudflare Sandbox SDK for container-based task execution - TailwindCSS with light/dark theme support Features ported from original pilot: - OAuth authentication (Google + GitHub) - Kanban board with 4 columns (Backlog, In Progress, Blocked, Done) - Task CRUD with execution in sandbox containers - Command palette (Cmd+K) for quick navigation - Project management with settings page - Task detail panel with logs and terminal access - Responsive design with status-colored indicators Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Set ENVIRONMENT=development in wrangler vars so dev mode auth bypass works - Create dev user in D1 on first request to avoid foreign key errors - Add .dev.vars to gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes Svelte 5 ssr_context.r error caused by store subscriptions running during server-side rendering without a component context. The pilot is a client-side SPA that requires browser APIs and auth. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace writable/derived stores with $state objects in .svelte.ts files. The old store pattern caused ssr_context errors and onMount not firing with ssr=false. Using $effect instead of onMount for initialization resolves the client-side hydration issue. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…oard shortcuts Migrate from Tailwind v3 to Tailwind v4 with basecoat-css component library. Major UI overhaul matching the Rails reference implementation: - Basecoat sidebar with collapsible state, chat list, nav items - Kanban board with vim-style navigation (hjkl/arrows), multi-select (x), bulk actions (run/delete/done), drag-and-drop, context menus - Task cards simplified to match Rails: title + spinner + badges + timestamp - Task detail modal with two-pane file viewer (preview/source/diff tabs) for tasks with artifacts, compact single-column for simple tasks - Native <dialog> elements for all modals with basecoat styling - Chat panel with quick actions that send messages directly - Keyboard shortcuts: Cmd+K search, N new task, Cmd+Enter execute, Cmd+Delete delete, Shift+arrows move tasks, [ ] toggle panels, ? help - UI state persistence (sidebar, chat panel, board width, focus position) - Polling reduced to 5s for near-realtime kanban updates - All button classes converted to basecoat compound format (btn-sm-ghost etc) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ld script Adds sandbox proxy support to worker-entry, updates wrangler bindings, and improves postbuild patching for agent routing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ields - New task_files table for tracking files generated by task execution - Add preview_url column to tasks for sandbox app preview URLs - Add github_repo and github_branch columns to projects - Extend API client with listFiles, getFileContent, and github helpers - Add TaskFile type and update Project/Task types accordingly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…flow - GET /api/tasks/:id/files — list files generated by task execution - GET /api/tasks/:id/file?path= — serve individual task file content - GET /preview/tasks/:id/... — proxy to sandbox for live app preview - POST /api/auth/github/device — start GitHub OAuth device flow - POST /api/auth/github/device/poll — poll for device flow completion - GET /api/auth/github/status — check GitHub connection status Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Cast toolCalls/toolResults to any for AI SDK v6 type compatibility - Cast platform env to any for SANDBOX binding access in SvelteKit - Update workflow with improved error handling Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Sidebar: collapsible project tree with drag-and-drop, active states - ProjectDialog: GitHub repo/branch fields, color picker improvements - ProjectsPage: refined layout with project cards and quick actions - TaskBoard/TaskCard: improved kanban styling and status indicators - Dashboard: updated layout and keyboard help improvements - LoginPage: cleaner auth flow layout - ChatPanel: improved message rendering - SettingsPage: minor label fixes - Add nav store for sidebar state management - Add projects store for reactive project state - Updated app.css with new design tokens and utility classes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Streaming duplication: A race condition in the WebSocket close handler caused stale sockets to overwrite the current taskWs reference to null, triggering reconnects that created duplicate connections. Both connections fed text deltas into the same store, doubling every phrase. Fixed by checking `taskWs === ws` in all event handlers to ignore stale sockets, and clearing the reference BEFORE calling close() in disconnectTaskChat. Message persistence: Messages were cleared on every disconnect, so reopening the modal lost conversation history. Now messages are only cleared when switching to a DIFFERENT task — the server restores them via cf_agent_chat_messages on reconnect to the same task. Modal overflow: TaskChat containers used shrink-0 with fixed heights, pushing content past the modal bounds. Changed to flex-1 with min-h constraints so the chat participates in flex layout properly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.